﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DddCms.Models.UIComponent.Accordion
{
    public class AccordionPannelViewModelBuilder
    {

        public AccordionPannelViewModelBuilder()
        {
            AccordionPannel = new AccordionPannelViewModel();
        }
        public AccordionPannelViewModel AccordionPannel { get; set; }

        public AccordionPannelViewModelBuilder Title(string title)
        {
            AccordionPannel.Title = title;
            return this;
        }

        public AccordionPannelViewModelBuilder Icon(string icon)
        {
            AccordionPannel.Icon = icon;
            return this;
        }

        public AccordionPannelViewModelBuilder SetIsOpen()
        {
            AccordionPannel.IsOpen = true;
            return this;
        }
        public AccordionPannelViewModelBuilder AddItemPannel( MvcHtmlString actionLink, string icon)
        {
            AccordionItemViewModel model = new AccordionItemViewModel()
            {
                ActionLink = actionLink,
                IconClass = icon
            };
            AccordionPannel.AccordionItem.Add(model);
            return this;
        }
        public AccordionPannelViewModelBuilder AddItemPannel(MvcHtmlString actionLink)
        {
            AccordionItemViewModel model = new AccordionItemViewModel()
            {
                ActionLink = actionLink,
                IconClass = null
            };
            AccordionPannel.AccordionItem.Add(model);
            return this;
        }

        public AccordionPannelViewModelBuilder ID(string ID)
        {
            AccordionPannel.ID = ID;
            return this;
        }
    }
}